<?php
//set_include_path('.:/php/includes:/home/diegolaprida/domains/simesev.com.ar/public_html/admin/core:/usr/lib/php:/usr/local/lib/php');
require_once 'Zend/Session/Namespace.php';

class SessionPlugin {

	
	/**
	 * Retorna la sessionVar del namespace
	 */
	public static function getSessionValue($sessionVar, $namespace) {
		$session = new Zend_Session_Namespace($namespace);
		if (isset($session->$sessionVar)) {
			return $session->$sessionVar;
		} else {
			return null;
		}
		
	}
	
	
	/**
	 * Setea una session var en un namespace
	 */
	public static function setSessionValue($value, $sessionVar, $namespace) {
		$session = new Zend_Session_Namespace($namespace);
		$session->$sessionVar = $value;
	}	

	
	/**
	 * Setea el expiration time para un namespace
	 */
	public static function setExpirationSeconds($namespace, $time) {
		$session = new Zend_Session_Namespace($namespace);
		if (isset($session)) {
			$session->setExpirationSeconds($time);
		}
	}
}